package com.atguigu.tingshu.user.client;

import com.atguigu.tingshu.common.result.Result;
import com.atguigu.tingshu.model.user.VipServiceConfig;
import com.atguigu.tingshu.user.client.impl.UserInfoDegradeFeignClient;
import com.atguigu.tingshu.vo.user.UserInfoVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.Map;

/**
 * <p>
 * 产品列表API接口
 * </p>
 *
 * @author qy
 */
@FeignClient(
        value = "service-user",
        contextId = "userInfoFeignClient",
        fallback = UserInfoDegradeFeignClient.class,
        path = "/api/rpc/userInfo")
public interface UserInfoFeignClient {

    /**
     * 远程查询用户微服务获取用户的基本信息
     * @param userId
     * @return
     */
    @GetMapping(value = "/getUserInfo/{userId}")
    Result<UserInfoVo> getUserInfo(@PathVariable(value = "userId") Long userId);

    @GetMapping(value = "/getUserPaidAlbumTrackList/{userId}/{albumId}")
    Result<Map<Long, String>> getUserPaidAlbumTrackList(@PathVariable(value = "userId") Long userId, @PathVariable(value = "albumId") Long albumId);

    @GetMapping(value = "/getUserPaidAlbum/{userId}/{albumId}")
    Result<Boolean> getUserPaidAlbum(@PathVariable(value = "userId") Long userId, @PathVariable(value = "albumId") Long albumId);


    @GetMapping(value = "/getAllVipConfig/{itemId}")
    Result<VipServiceConfig> getAllVipConfig(@PathVariable(value = "itemId") Long itemId);
}